What’s up with homeruns?

How have home run rates changed over time?

andrewstiegler
2022-09-01

How have home run rates changed? Are there more homeruns now than ever?

In order to look at baseball data in R, we need a good baseball database. Luckily one exists for R already - the Lahman dataset.

In fact, there’s even an R package available for it thanks to Chris Dalzell and his team.

Let’s use this dataset to figure out if homerun rates are high now compared to historical data. First, what’s the average rate of home runs per plate appearance over time? Checking the data…

It looks like 2020 was an outlier, so let’s smooth the data and look for a trend over time by checking the time series is stationary. We can use the Augmented Dickey-Fuller test from the tseries package.

    Augmented Dickey-Fuller Test

data:  .
Dickey-Fuller = -2.71, Lag order = 4, p-value = 0.287
alternative hypothesis: stationary